package com.shop.entity;

// Generated 2015-10-7 22:59:34 by Hibernate Tools 4.0.0

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * News generated by hbm2java
 */
@Entity
@Table(name = "news", catalog = "shop")
public class News implements java.io.Serializable {

	private Integer newId;
	private String newUuid;
	private String newContent;
	private String newType;
	private Date newDate;
	private Integer shopId;
	private Set<PictureRelate> pictureRelates = new HashSet<PictureRelate>(0);

	public News() {
	}

	public News(String newUuid, String newType, Date newDate) {
		this.newUuid = newUuid;
		this.newType = newType;
		this.newDate = newDate;
	}

	public News(String newUuid, String newContent, String newType,
			Date newDate, Integer shopId, Set<PictureRelate> pictureRelates) {
		this.newUuid = newUuid;
		this.newContent = newContent;
		this.newType = newType;
		this.newDate = newDate;
		this.shopId = shopId;
		this.pictureRelates = pictureRelates;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "new_id", unique = true, nullable = false)
	public Integer getNewId() {
		return this.newId;
	}

	public void setNewId(Integer newId) {
		this.newId = newId;
	}

	@Column(name = "new_uuid", nullable = false, length = 32)
	public String getNewUuid() {
		return this.newUuid;
	}

	public void setNewUuid(String newUuid) {
		this.newUuid = newUuid;
	}

	@Column(name = "new_content", length = 200)
	public String getNewContent() {
		return this.newContent;
	}

	public void setNewContent(String newContent) {
		this.newContent = newContent;
	}

	@Column(name = "new_type", nullable = false, length = 12)
	public String getNewType() {
		return this.newType;
	}

	public void setNewType(String newType) {
		this.newType = newType;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "new_date", nullable = false, length = 19)
	public Date getNewDate() {
		return this.newDate;
	}

	public void setNewDate(Date newDate) {
		this.newDate = newDate;
	}

	@Column(name = "shop_id")
	public Integer getShopId() {
		return this.shopId;
	}

	public void setShopId(Integer shopId) {
		this.shopId = shopId;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "news")
	public Set<PictureRelate> getPictureRelates() {
		return this.pictureRelates;
	}

	public void setPictureRelates(Set<PictureRelate> pictureRelates) {
		this.pictureRelates = pictureRelates;
	}

}
